package space.xxhui;

import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import space.xxhui.DAO.UserDao;
import space.xxhui.POJO.User;

/**
 * Created by hui on 2017/7/24.
 */
public class UserDAOTest2 {

    @Test
    public void testDB(){
        BeanFactory beanFactory = new ClassPathXmlApplicationContext("spring/spring-orm.xml");
        UserDao userDao = (UserDao)beanFactory.getBean("userDao");
        User user = userDao.getUserById(1);
        System.out.println(user.toString());
        User user1 = userDao.getUserByIdForAnnotation(2);
        System.out.println(user1.toString());
    }
}
